import React from 'react';
import { Router, Route, Switch } from 'dva/router';
// import IndexPage from './routes/IndexPage';
// import News from './routes/news';
// import NewsList from './routes/newsList';
import asyncComponent from './utils/asyncComponent.js';
const IndexPage = asyncComponent(() => import('./routes/IndexPage'));
const News = asyncComponent(() => import('./routes/news'));

function RouterConfig({ history }) {
  return (
    <Router history={history}>
      <Switch>
        <Route path="/" exact component={IndexPage} />
        <Route path="/news" exact component={News} />
        {/* <Route path="/news/list" exact component={NewsList} /> */}
      </Switch>
    </Router>
  );
}

export default RouterConfig;
